package main.java.com.chegg.coursepicker;
import java.io.File;

import tml.storage.*;
public class AddingFilesToRepository {
	 public  void addFilesToRepository() throws Exception {
        //delete old repository
		 File file = new File("C://opt//docs//repository");         
	        String[] myFiles;       
	            if(file.isDirectory()){   
	                myFiles = file.list();   
	                for (int i=0; i<myFiles.length; i++) {   
	                    File myFile = new File(file, myFiles[i]);    
	                    myFile.delete();   
	                }   
	             }   

	        Repository repository = new Repository("C://opt//docs//repository");
	 
	        repository.addDocumentsInFolder("C://opt//docs//source//temp");
	         
	        System.out.println("Documents added to repository successfully!");
	     }

}

